using System;

namespace SanFS.MediaChangerLibrary
{
    /// <summary>
    /// Base class representing a storage element
    /// </summary>
	public abstract class StorageElement : IStorageElement, IStorageElementFactoryHelper
	{
		private LoadStatus      mStatus;
		private int			    mDeviceSlot;
		private ElementType	    mType;
		private IMediaChanger   mMediaChanger;
		
		public StorageElement(ElementType Type, IMediaChanger MediaChanger, int DeviceSlot, LoadStatus Status)
		{
			mStatus = Status;
			mDeviceSlot = DeviceSlot;
			mType = Type;
			mMediaChanger = MediaChanger;
        }

        #region IStorageElementFactoryHelper Members
        public abstract IStorageElement CreateInstance(IMediaChanger MediaChanger, int DeviceSlot, LoadStatus Status);

        public string Key
        {
            get { return mType.ToString(); }
        }
        #endregion

        #region IStorageElement Members
        public int DeviceSlot
		{
			get { return mDeviceSlot; }
		}
		
		public LoadStatus   Status
		{
			get { return mStatus; }
		}
		
		public ElementType Type
		{
			get { return mType; }
        }

        public void Load(IStorageElement SrcElement)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public void Unload(IStorageElement DstElement)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public IMediaChanger MediaChanger
        {
            get { return mMediaChanger; }
        }

        #endregion
    }  // END INTERFACE
}  // END NAMESPACE
